<include file="header" />
<div class="wraper">
    <!--<div class="head clearfix">
        <a href="#" class="iconfont icon-zuo"></a>
        <span class="head-name">户外场地列表</span>
    </div>-->
    <div class="head head-search clearfix">
        <a href="javascript:history.back(-1);" class="iconfont icon-zuo" style="width: 10%;"></a>
        <div class="search-box">
            <input name="meeting_name" placeholder="请搜索露天场所名称" class="search" />
            <span class="iconfont icon-sousuo text-green"></span>
        </div>
        <a href="javascript:void(0);" class="iconfont icon-shaixuan2 filter" data-account_id="{BEESCRM:$accountId}"></a>
    </div>

    <div class="lists content">
        <div class="list-line text-gray">共<php>echo count($data);</php>个露天场所</div>
            <if condition="!empty($data)">
                <foreach name="data" item="vo">
                    <a href="{BEESCRM::U('/meeting/meetingRoom/weekPanel',array('outDoor' => 1,'level' => 0,'account_id' => $accountId,'meeting_room_id' => $vo['meeting_room_id']))}" class="list-line tb-mode">
                        <div class="tb-cell lineheight2">
                            <p>{BEESCRM:$vo.room_name}</p>
                            <p>{BEESCRM:$vo.area_name}</p>
                            <p class="text-12">{BEESCRM:$vo.address}</p>
                        </div>
                        <div class="tb-cell text-right"><span class="iconfont icon-you"></span></div>
                    </a>
               </foreach>
            <else />
                <div class="norecord">
                    <img src="/assets/meeting/images/news.png"/>
                    <p class="text-gray">暂无可预约户外场地</p>
                </div>
            </if>
    </div>

    <div class="nav three-nav">
        <a href="#" class="nav-list actived">
            <span class="iconfont icon-1"></span>
            <span>场馆列表</span>
        </a>
        <a href="{BEESCRM::U('/meeting/MeetingOutDoorBespeak/add/',array('account_id' => $accountId))}" class="nav-list">
            <span class="iconfont icon-plus-copy"></span>
            <span>我要预约</span>
        </a>
        <a href="{BEESCRM::U('/meeting/MeetingAppoint/unaudited/',array('account_id' => $accountId))}" class="nav-list">
            <span class="iconfont icon-gerenzhongxin"></span>
            <span>我的预约</span>
        </a>
    </div>

</div>
<script type="text/javascript" src="/assets/public/seajs/sea.js"></script>
<script enter="publicjs/public" id="confnode" async="async" src="/assets/public/config.js"></script>
<script type="text/javascript" src="/assets/public/jquery-2.1.0.min.js"></script>
<include file="doorfilter" />

<script>
    $(document).on('click','.filter',function() {
        $(".pop-box").show();
    })

    $('.search').bind('input propertychange',function(){
        var data = {};
        data.meeting_name = $(this).val();
        var content = '';
        $.ajax({
            url: '/meeting/meetingRoom/getMeetingRoomByName/account_id/{BEESCRM:$accountId}/room_type/2',
            type: 'post',
            data: data,
            dataType: 'json',
            success:function(data) {
                console.log(data);
                if(data.status == 'S') {
                    var room = data.message;
                    if(!room || room == null) {
                        content = '<div class="list-line text-gray">共0个露天场所</div><div class="norecord"> <img src="/assets/meeting/images/nomeeting.png"/> <p class="text-gray">无相关会议室</p> </div>';
                    } else {
                        content = content + '<div class="list-line text-gray">共'+room.length+'个露天场所</div>'
                        $.each(room,function(key,value) {
                            content = content +  '<a href="/meeting/meetingRoom/weekPanel/outDoor/1/level/0/account_id/{BEESCRM:$accountId}/meeting_room_id/'+value['meeting_room_id']+'" class="list-line tb-mode"><div class="tb-cell lineheight2"> ' +
                                    '<p>'+value['room_name']+'</p>' +
                                    '<p>'+value['area_name']+'</p>' +
                                    ' <p class="text-12">'+value["address"]+'</p> ' +
                                    '</div> ' +
                                    '<div class="tb-cell text-right"><span class="iconfont icon-you"></span></div> ' +
                                    '</a>';

                        })
                    }
                    console.log(content);
                    $(".content").html(content);

                } else if(data.status == 'F') {

                }
            }
        });
    })

    </script>
</body>
</html>